import os
fileList = [];
rootdir = "./"

for root, subFolders ,files in os.walk(rootdir):
    if 'other' in subFolders:
        subFolders.remove('other');  #排除特定目录
    for file in files:
        if file.find('.txt') != -1: # 查找特定扩展名文件
            print(file);
